//
//  NSDate+YFExtension.h
//  CalendarDemo
//
//  Created by Winny Zhang on 2019/4/2.
//  Copyright © 2019 Winny Zhang. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSDate (YFExtension)

/**
 指定日期年份
 */
@property (nonatomic, assign, readonly) NSInteger currentYear;
/**
 指定日期月份
 */
@property (nonatomic, assign, readonly) NSInteger currentMonth;
/**
 指定日期几号
 */
@property (nonatomic, assign, readonly) NSInteger currentDay;
/**
 指定日期小时
 */
@property (nonatomic, assign, readonly) NSInteger currentHour;
/**
 指定日期分钟
 */
@property (nonatomic, assign, readonly) NSInteger currentMinute;
/**
 指定日期秒钟
 */
@property (nonatomic, assign, readonly) NSInteger currentSecond;

/**
 当地时间
 */
@property (nonatomic, strong, readonly) NSDate *localeDate;
/**
 判断date是否在指定的时间段内
 
 @param firstDate 时间段的开始date
 @param lastDate 时间段的结束date
 @return 是否在时间段内
 */
- (BOOL)isBetweenDate:(NSDate*)firstDate andDate:(NSDate*)lastDate;

/**
 指定年月 返回当月天数
 
 @param year 年
 @param month 月
 @return 天数长度
 */
+ (NSInteger)daysWithYear:(NSInteger)year month:(NSInteger)month;

@end

NS_ASSUME_NONNULL_END
